package com.leon.alishop.core.bo;

import java.util.ArrayList;
import java.util.List;

import com.leon.alishop.core.enumeration.GoodsStatusEnum;
import com.leon.alishop.core.model.AttributesModel;
import com.leon.alishop.model.GoodsInfo;
import com.leon.alishop.model.GoodsSku;
import com.leon.alishop.model.ProviderInfo;

public class GoodsBo extends GoodsInfo {

	private static final long serialVersionUID = 1L;

	private String minImgUrl;
	
	public String getMinImgUrl() {
		return minImgUrl;
	}

	public void setMinImgUrl(String minImgUrl) {
		this.minImgUrl = minImgUrl;
	}

	public String getTaobaoItemUrl(){
		return "http://item.taobao.com/item.htm?id="+super.getProviderTaobaoGoodsId();
	}
	
	
	/**
	 * sku列表
	 */
	private List<GoodsSku> skuList;
	
	/**
	 * 属性
	 */
	private List<AttributesModel> attributesList;
	
	
	/**
	 * 行 size
	 * 列 color
	 */
	private List<List<GoodsSkuBo>> skuTable;
	
	
	public List<List<GoodsSkuBo>> getSkuTable() {
		return skuTable;
	}

	public void setSkuTable(List<List<GoodsSkuBo>> skuTable) {
		this.skuTable = skuTable;
	}
	private ProviderInfo providerInfo;
	
	public void addAttributesModel(AttributesModel attributesModel){
		if(null == attributesList)
			attributesList = new ArrayList<AttributesModel>();
		attributesList.add(attributesModel);
	}
	
	public List<AttributesModel> getAttributesList() {
		return attributesList;
	}

	public void addGoodsSku(GoodsSku goodsSku){
		if(null == skuList)
			skuList = new ArrayList<GoodsSku>();
		skuList.add(goodsSku);
	}
	
	public List<GoodsSku> getSkuList() {
		return skuList;
	}

	public void addGoodsSku(List<GoodsSku> goodsSkus){
		if(null == skuList)
			skuList = new ArrayList<GoodsSku>();
		skuList.addAll(goodsSkus);
	}

	public ProviderInfo getProviderInfo() {
		return providerInfo;
	}

	public void setProviderInfo(ProviderInfo providerInfo) {
		this.providerInfo = providerInfo;
	}
	
	public GoodsStatusEnum getStatusEnum(){
		return GoodsStatusEnum.valueOfOrdinal(super.getStatus());
	}
	
	public GoodsStatusEnum getProviderStatusEnum(){
		return GoodsStatusEnum.valueOfOrdinal(super.getProviderStatus());
	}

}
